package net.csdra.basis.domain;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;
import java.util.List;

/**
 * Created by msf on 2018/1/23.
 */
@NoRepositoryBean
public interface CJpaRepository<T extends EntityBase, ID extends Serializable> extends JpaRepository<T, ID>, JpaSpecificationExecutor<T> {

    T findByIdAndEnabledIsTrue(ID id);

    List<T> findByMetaId(String metaId);

    Page<T> findByMetaId(String metaId, Pageable pageable);

    List<T> findByMetaIdAndEnabledIsTrue(String metaId);

    Page<T> findByMetaIdAndEnabledIsTrue(String metaId, Pageable pageable);

}
